package com.tron.dobest.schedule;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @description 任务启动
 * @auther gaoli
 * @create 2019-12-31
 */
@Component
@Slf4j
public class TronScheduleBootStrap implements ApplicationListener<ApplicationStartedEvent> {

    @Autowired
    TronTaskController tronTaskController;

    @Override
    public void onApplicationEvent(ApplicationStartedEvent event) {
        log.info("======监听方法执行======");
        tronTaskController.addTask01("1");
    }
}
